package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.example.domain.Manufacture;

import java.util.List;

@Mapper
public interface ManufactureMapper extends BaseMapper<Manufacture> {
    List<Manufacture> queryAll();

    Manufacture queryById(Integer id);

    @Insert("insert into tb_manufacture(name,date,space) values(#{name},#{date},#{space})")
    void add(Manufacture manufacture);

    @Delete("delete from tb_manufacture where id=#{id}")
    void deletebyId(Integer id);

    @Update("update tb_manufacture set name=#{name},date=#{date},space=#{space} where id=#{id}")
    void updateManufacture(Manufacture manufacture);

    @Select("select password from tb_manufacture where name=#{name} ")
    Integer getPassword(String name, Integer password);
}
